<?php


class Zend_View_Helper_LocationOfDish extends Zend_View_Helper_Abstract
{


	public function locationOfDish(Model_LocationOfDish $loc)
	{
		$name=$loc->getLocation()->getName();
		$address=$loc->getLocation()->getAddress();
		$quantity=$loc->getQuantity();
		$price=$loc->getPrice();
		$image=$loc->getLocation()->getImage();
		$nameDish=$loc->getName();
		$link= "/location/detail";
		$link=$link.'?id='.$loc->getLocation()->getId();
		$id=$loc->getId();
		$result='
				<div class="LocationOfDish">
					<img src="'.$image.'"></img>
					<div class="locationInfo">
						<span class="locationTitle-small"><a href="'.$link.'">'.$name.'</a></span> <br />
						<span class="locationAddress-small">'.$address.'</span> <br />
						Dish: <span class="nameOfDish">'.$nameDish.'</span> <br/>
						Price: <span class="price">'.$price.'đ</span> <br />
						Quantity: <span class="quantity">'.$quantity.'</span> <br />
								<div class="locationInfo">
									<form method="get" action=""  class="frm"  id="frm'.$id.'">
										<span>Enter quantity: </span>
										<input type="text" class="txtNumber" id="quantity" name="quantity" />
										<input type="hidden" class="txtNumber" id="id" value="'.$id.'" name="id" />
										<input type="hidden" class="txtNumber" id="maxQuantity" value="'.$quantity.'" name="maxQuantity" />
										<button type="submit" id="'.$id.'"  class="buttonbuy button">Buy</button>
									</form>
												<div id="errorStatus"></div>
								</div>	
					</div>
					
				</div>
				';

		return $result;
	}

	

}
